# -*- coding: utf-8 -*-
import shutil

from re_utils import scan_files, dir_path, bak_dir_path

if __name__ == '__main__':
    try:
        try:
            shutil.copytree(dir_path, bak_dir_path)
            print(f"{dir_path} 备份成功")
        except Exception as e:
            print(f"备份失败错误: {e}")
        try:
            def compress_directory(directory_path, output_path):
                shutil.make_archive(output_path, 'zip', directory_path)
            # 使用示例
            compress_directory(dir_path, bak_dir_path)
            print(f"{dir_path} 压缩成功")
        except Exception as e:
            print(f"压缩失败错误: {e}")
    except Exception as e:
        print(f"错误: {e}")
    pass
